package com.springboot.frame.starter.pay.v3.resq;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * @author liheng
 * @ClassName FacilV3PayResqBody
 * @Description 公共请求体
 * @date 2021-08-31 21:18
 */
public class FacilV3PayResqBody {
    @JsonProperty("sp_mchid")
    private String spMchid;
    @JsonProperty("sub_mchid")
    private String subMchid;
    @JsonProperty("sp_appid")
    private String spAppid;
    @JsonProperty("sub_appid")
    private String subAppid;
    @JsonProperty("out_trade_no")
    private String outTradeNo;
    private String description;
    @JsonProperty("notify_url")
    private String notifyUrl;
    private String attach;
    private Amount amount;
    private Payer payer;

    /**
     * 必填项构造参数
     * @param subMchid
     * @param outTradeNo
     * @param description
     * @param amount
     * @param payer
     */
    public FacilV3PayResqBody(String subMchid, String outTradeNo, String description, Amount amount, Payer payer) {
        this.subMchid = subMchid;
        this.outTradeNo = outTradeNo;
        this.description = description;
        this.amount = amount;
        this.payer = payer;
    }

    /**
     * -订单金额
     */
    public static class Amount {

        private int total;
        /**
         * CNY：人民币，境内商户号仅支持人民币。
         */
        private String currency="CNY";

        public void setTotal(int total) {
            this.total = total;
        }

        public int getTotal() {
            return total;
        }

        public void setCurrency(String currency) {
            this.currency = currency;
        }

        public String getCurrency() {
            return currency;
        }

        public Amount(int total) {
            this.total = total;
        }
    }

    /**
     * 支付者
     */
    public static class Payer {
        @JsonProperty("sp_openid")
        private String spOpenid;
        @JsonProperty("sub_openid")
        private String subOpenid;

        public String getSpOpenid() {
            return spOpenid;
        }

        public void setSpOpenid(String spOpenid) {
            this.spOpenid = spOpenid;
        }

        public String getSubOpenid() {
            return subOpenid;
        }

        public void setSubOpenid(String subOpenid) {
            this.subOpenid = subOpenid;
        }

        public Payer(String spOpenid) {
            this.spOpenid = spOpenid;
        }


    }

    public String getSpMchid() {
        return spMchid;
    }

    public void setSpMchid(String spMchid) {
        this.spMchid = spMchid;
    }

    public String getSubMchid() {
        return subMchid;
    }

    public void setSubMchid(String subMchid) {
        this.subMchid = subMchid;
    }

    public String getSpAppid() {
        return spAppid;
    }

    public void setSpAppid(String spAppid) {
        this.spAppid = spAppid;
    }

    public String getSubAppid() {
        return subAppid;
    }

    public void setSubAppid(String subAppid) {
        this.subAppid = subAppid;
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    public void setNotifyUrl(String notifyUrl) {
        this.notifyUrl = notifyUrl;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getDescription() {
        return description;
    }

    public String getAttach() {
        return attach;
    }

    public void setAttach(String attach) {
        this.attach = attach;
    }

    public void setAmount(Amount amount) {
        this.amount = amount;
    }

    public Amount getAmount() {
        return amount;
    }

    public void setPayer(Payer payer) {
        this.payer = payer;
    }

    public Payer getPayer() {
        return payer;
    }

}
